import { createVNode } from 'vue'
import * as antIcons from '@ant-design/icons-vue'
import { createFromIconfontCN } from '@ant-design/icons-vue'

const IconAntdv = props => {
  const { icon } = props
  if (antIcons[icon]) {
    return createVNode(antIcons[icon])
  }
  return createVNode(antIcons.QuestionOutlined)
}

const IconFont = createFromIconfontCN({
  scriptUrl: '//at.alicdn.com/t/font_2853414_tnevlu5zwzp.js'
})

export default function (app) {
  app.component('IconAntdv', IconAntdv)
  app.component('IconFont', IconFont)
}
